package com.cn.service.impl;

import com.cn.mapper.OrdersMapper;
import com.cn.pojo.Order;
import com.cn.pojo.OrderItem;
import com.cn.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:王宇航
 * @create: 2023-05-24 16:00
 * @Description:
 */
@Service
public class OrdersServiceImpl implements OrdersService {
   @Autowired
   private OrdersMapper ordersMapper;
    @Override
    public Order selectOrderNo(String id) {
        return ordersMapper.selectOrderNo(id);
    }

    @Override
    public void updateById2(Order order) {
        ordersMapper.updateById2(order);
    }

    @Override
    public void createOrder(Order order) {
        ordersMapper.createOrder(order);

    }

    @Override
    public void createOrderItem(OrderItem orderItem) {
        ordersMapper.createOrderItem(orderItem);
    }

    @Override
    public void updatePayStatus(String orderNo) {
        ordersMapper.updatePayStatus(orderNo);
    }

    @Override
    public int payStatus(String orderNo) {
        int i = ordersMapper.payStatus(orderNo);
        return i;
    }

    @Override
    public void deleOrder(String orderNo) {
         ordersMapper.deleOrder(orderNo);
    }

    @Override
    public int findOrderMoney(String orderNo) {
        return ordersMapper.findOrderMoney(orderNo);
    }

    @Override
    public List<Order> selectAll(Order order) {
        return ordersMapper.selectAll(order);
    }
    @Override
    public  List<Order> searchOrderDetail(int id) {
        return ordersMapper.searchOrderDetail(id);
    }
}
